<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{margin: 0;padding:0;box-sizing: border-box}
        #box{
            height: 200px;
            border:solid 1px #666;
        }
    </style>
</head>
<body>
    <div id="box">

    </div>

    <script>
        let box = document.querySelector('#box');

        //绑定事件
        box.addEventListener('touchstart', function(e){
            // console.log(e);
            //获取触点的信息
            this.innerHTML = `同时按下的触点个数: ${e.changedTouches.length} 
                        <br>事件源身上的触点个数: ${e.targetTouches.length}
                        <br>屏幕上的触点个数: ${e.touches.length}`;
            e.preventDefault()
        })

        box.addEventListener('touchmove', function(e){
            // console.log(e);
            //获取触点的信息
            this.innerHTML = `同时滑动的触点个数: ${e.changedTouches.length} 
                        <br>事件源身上的触点个数: ${e.targetTouches.length}
                        <br>屏幕上的触点个数: ${e.touches.length}`;
            e.preventDefault()
        })

        box.addEventListener('touchend', function(e){
            // console.log(e);
            //获取触点的信息
            this.innerHTML = `同时抬起的触点个数: ${e.changedTouches.length} 
                        <br>事件源身上的触点个数: ${e.targetTouches.length}
                        <br>屏幕上的触点个数: ${e.touches.length}`;
            e.preventDefault()
        })

    </script>
</body>
</html>